<template>
  <div class="logo" :class="`size-${size} ${multLine ? 'mult-line' : ''}`">
    <div class="img" @click="router.push('/home')"></div>
    <div class="text" @click="router.push('/home')">BLOCKJOKER</div>
    <div class="rgb-text">
      <span class="rgb-r">R</span>
      <span class="rgb-g">G</span>
      <span class="rgb-b">B</span>
    </div>
  </div>
</template>

<script setup>
import { defineProps } from 'vue'
import { useRoute, useRouter } from 'vue-router'
const router = useRouter()
defineProps({
  size: {
    type: String,
    default: ''
  },
  multLine: {
    type: Boolean,
    default: false
  }
})
</script>

<style lang="less" scoped>
.logo {
  display: flex;
  flex-direction: row;
  .img {
    width: 20px;
    height: 20px;
    background: url(../assets/images/joker.png) center center no-repeat;
    background-size: 100% 100%;
    cursor: pointer;
  }
  .text {
    padding: 0 0 0 10px;
    color: var(--primary);
    line-height: 20px;
    font-size: 20px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
  }
  .rgb-text {
    display: flex;
    margin: 0 0 0 5px;
    gap: 2.5px;
    font-size: 10px;
    font-weight: 600;
    font-family: 'Source Code Pro', monospace;
    opacity: 0.95;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 7px;
    border-radius: 4px;
    border: 1px solid rgba(0, 246, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 246, 255, 0.1);
  }

  .rgb-r, .rgb-g, .rgb-b { 
    font-weight: 600;
    text-shadow: 0 0 12px currentColor;  /* 增强发光 */
    letter-spacing: 0.5px;  /* 添加字母间距 */
  }

  .rgb-r { 
    color: #FF3B30; 
    animation: glitch 2s infinite;
  }

  .rgb-g { 
    color: #00F6FF; 
    animation: glitch 2s infinite 0.67s;
  }

  .rgb-b { 
    color: #007AFF; 
    animation: glitch 2s infinite 1.33s;
  }

  @keyframes glitch {
    0%, 90%, 100% { opacity: 0.7; transform: none; }
    92% { opacity: 0.9; transform: translate(-1px, 1px); }
    94% { opacity: 0.8; transform: translate(1px, -1px); }
    96% { opacity: 0.9; transform: translate(-1px, -1px); }
    98% { opacity: 0.8; transform: translate(1px, 1px); }
  }
}

</style>